package com.glasses.orm.controller;

import com.alibaba.fastjson.JSONObject;
import com.glasses.orm.base.Ex.BaseControllerEx;
import com.glasses.orm.service.WxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 微信相关接口
 * Created by ashin on 2018/8/13.
 */
@RestController
@RequestMapping("wx/api")
@Scope("prototype")
public class WxController extends BaseControllerEx {

    @Autowired
    WxService wxService;

    @RequestMapping(value = "login")
    public JSONObject login(@RequestParam Map map) throws Exception {
        return wxService.login(map);
    }

    @RequestMapping(value = "payCallback")
    public void payCallback() throws Exception {
        wxService.payCallback(request,response);
    }
}
